home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / dev / c / AmiVoGL_MDEV.lha / hershey / src / halloc.c < prev    next >
C/C++ Source or Header  |  1994-08-06  |  463b  |  27 lines

  1. /* halloc.c: */
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include "vogl.h"
  5. #include "hershey.h"
  6.  
  7. /* --------------------------------------------------------------------- */
  8.  
  9. /*
  10.  * hallocate
  11.  *
  12.  *    Allocate some memory, barfing if malloc returns NULL.
  13.  */
  14. char * hallocate(unsigned size)
  15. {
  16.     char    *p;
  17.  
  18.  
  19.     if ((p = (char *)malloc(size)) == (char *)NULL) {
  20.         fprintf(stderr,"hallocate: request for %u bytes returned NULL", size);
  21.         gexit();
  22.         exit(1);
  23.     }
  24.  
  25.     return (p);
  26. }
  27.